package org.rcy.framework.data.dao;

import tk.mybatis.mapper.code.Style;
import tk.mybatis.mapper.entity.Config;
import tk.mybatis.mapper.mapperhelper.MapperHelper;

public class MapperHelperFactory {
    private static MapperHelper mapperHelper;

    public MapperHelperFactory() {
    }

    public static MapperHelper getMapperHelper() {
        if (mapperHelper == null) {
            Config config = new Config();
            config.setResolveClass(EntityResolveImpl.class);
            config.setSafeDelete(true);
            config.setStyle(Style.normal);
            config.setEnumAsSimpleType(true);
            mapperHelper = new MapperHelper();
            mapperHelper.setConfig(config);
        }

        return mapperHelper;
    }
}